package com.easypay.reactive8583;

import io.netty.bootstrap.AbstractBootstrap;
import io.netty.channel.ChannelPipeline;

/**
 * @author pandans
 * @date 2021/03/04 14:57
 * @Description:
 */
public abstract class ConnectorConfigurer<C extends ConnectorConfiguration, B extends AbstractBootstrap<?, ?>> {
    /**
     * Hook added before completion of the bootstrap configuration.
     *
     *
     * This method is called during [AbstractIso8583Connector.init] phase.
     *
     *
     *
     * This implementation does nothing
     *
     * @param bootstrap     AbstractBootstrap to configure
     * @param configuration A [ConnectorConfiguration] to use
     */
    void configureBootstrap(B bootstrap, C configuration) {
        // this method was intentionally left blank
    }

    /**
     * Hook added before completion of the pipeline configuration.
     *
     *
     * This method is called during
     * [com.github.kpavlov.jreactive8583.netty.pipeline.Iso8583ChannelInitializer.initChannel] phase.
     *
     *
     * This implementation does nothing
     *
     * @param pipeline      A [ChannelPipeline] being configured
     * @param configuration A [ConnectorConfiguration] to use
     */
    public void configurePipeline(ChannelPipeline pipeline, C configuration) {
        // this method was intentionally left blank
    }
}
